<template>
  <div class="dashboard-container">
    <div>
      <el-card class="box-card">
        这是主页面
        <div>
          <!-- <img
            src="dev-api/web/image?model=res.partner&id=16&field=image_128"
          />
          <img src="dev-api/web/image/357" />
          <img
            src="dev-api/web/image?model=res.partner&id=16&field=image_1920"
          />
          <img
            src="dev-api/web/image?model=res.partner&id=10&field=image_1920"
          />
          <img
            src="dev-api/web/image?model=hr.employee&id=4&field=image_1920"
          /> -->
        </div>
        <div>
          <div v-for="rec in records" :key="rec.id">
            <div v-for="fld in Object.keys(rec)" :key="fld">
              {{ fld }}, {{ rec[fld] }}
            </div>
            <div>--------</div>
          </div>
        </div>

        <!-- {{ userinfo }} -->
      </el-card>
    </div>
  </div>
</template>

<script>
import odoo from '@/odooapi'

export default {
  name: 'Dashboard',
  components: {},
  data() {
    return {
      records: [],
      userinfo: {}
    }
  },
  computed: {},
  async created() {},

  mounted() {},
  methods: {
    async testNewMethod() {
      const obj = odoo.env('purchase.order')
      const context = { create_bill: true }
      const action = await obj.call('action_view_invoice', [3], { context })
      console.log('xxxx,home,', action)
      const move_obj = odoo.env('account.move')

      const fields = {
        type: null,
        state: null,
        name: null,
        company_id: null,
        partner_id: null,
        partner_shipping_id: null,
        ref: null,
        invoice_date: null,
        invoice_date_due: null,
        invoice_user_id: { name: null, login: null },
        invoice_origin: null,

        amount_total: null,
        amount_residual: null,
        invoice_outstanding_credits_debits_widget: null,
        invoice_payments_widget: null,
        invoice_has_outstanding: null,
        invoice_payment_state: null,

        invoice_line_ids: {
          product_id: null,
          name: null,
          account_id: null,
          price_unit: null,
          quantity: null,
          price_subtotal: null
        }
      }

      const sss = await move_obj.call('new2', [{}], {
        context: action.context,
        onchange: ['_onchange_purchase_auto_complete'],
        fields
        // fields: {}
      })
      console.log('xxxx,home,', sss)
    }
  }
}
</script>
<style></style>
